{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1. join_mcc_media_session_success\n",
      "2. join_mcc_media_session_failed_internal\n",
      "3. join_mcc_media_session_failed\n",
      "4. join_mcs_media_session_failed_internal\n",
      "5. join_mcs_media_session_failed\n",
      "6. join_mcs_media_session_success\n",
      "7. join_mcs_media_session_success\n",
      "8. get_device_list_success\n",
      "9. get_device_list_fail\n",
      "10. remote_stream_play_failed\n",
      "11. pc_disconnected\n",
      "12. open_peer_connection_failed\n",
      "13. media_bound_to_signal_channel_failed\n",
      "14. media_bound_to_signal_channel_success\n",
      "15. pc_disconnected\n",
      "16. pc_connected\n",
      "17. mute_local_audio_stream\n",
      "18. video_receive_success\n",
      "19. start_VoIP_session\n",
      "20. reconnectPCs\n",
      "21. restart_VoIP_session\n",
      "22. stop_VoIP_session\n",
      "23. start_video_session\n",
      "24. restart_video_session\n",
      "25. stop_video_session\n",
      "26. send_my_video\n",
      "27. stop_my_video\n",
      "28. video_send_fail\n",
      "29. video_send_success\n",
      "30. video_send_success\n",
      "31. handle_send_video\n",
      "32. subscribe_video\n",
      "33. unsubscribe_video\n",
      "34. start_sharing_session\n",
      "35. start_sharing_session\n",
      "36. sharing_receive_success\n",
      "37. sharing_send_success\n",
      "38. sharing_send_fail\n",
      "39. stop_sharing_session_ex\n",
      "40. stop_sharing_session\n",
      "41. restart_sharing_session_mcs\n",
      "42. restart_sharing_session_cb\n"
     ]
    }
   ],
   "source": [
    "import re\n",
    "\n",
    "theLines = '''\n",
    "/src/cscc.clientSession.js:                self.sendTelemetry('join_mcc_media_session_success', {\n",
    "./src/cscc.clientSession.js:                self.sendTelemetry('join_mcc_media_session_failed_internal', {\n",
    "./src/cscc.clientSession.js:                    self.sendTelemetry('join_mcc_media_session_failed', {\n",
    "./src/cscc.clientSession.js:                self.sendTelemetry('join_mcs_media_session_failed_internal', {\n",
    "./src/cscc.clientSession.js:                        self.sendTelemetry('join_mcs_media_session_failed', {\n",
    "./src/cscc.clientSession.js:        this.sendTelemetry('join_mcs_media_session_success', {\n",
    "./src/cscc.clientSession.js:        this.sendTelemetry('join_mcs_media_session_success', {\n",
    "./src/cscc.clientSession.js:    ClientSession.prototype.sendTelemetry = function (eventType, report) {\n",
    "./src/cscc.clientSession.js:        if (this.m_pSink && this.m_pSink.sendTelemetry) {\n",
    "./src/cscc.clientSession.js:            this.m_pSink.sendTelemetry(eventType, report);\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry('get_device_list_success', {list: deviceList});\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry('get_device_list_fail', {\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry((report.micInstalledChange.type === 'add' ? 'microphone_added' : 'microphone_removed'), {devices: report.micInstalledChange.devices})\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry((report.speakerInstalledChange.type === 'add' ? 'speaker_added' : 'speaker_removed'), {devices: report.speakerInstalledChange.devices})\n",
    "./src/cscc.mediacc.js:                this.sendTelemetry((report.camInstalledChange.type === 'add' ? 'camera_added' : 'camera_removed'), {devices: report.camInstalledChange.devices});\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry(eventType, eventDetail);\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry('remote_stream_play_failed', {\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry('pc_disconnected', { peerId: arg });\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry(\"open_peer_connection_failed\", {peerId: arg.peerId});\n",
    "./src/cscc.mediacc.js:                this.sendTelemetry('media_bound_to_signal_channel_failed', {\n",
    "./src/cscc.mediacc.js:                this.sendTelemetry('media_bound_to_signal_channel_success', {\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry('pc_disconnected', { peerId: arg });\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry('pc_connected', { peerId: arg });\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry(\"mute_local_audio_stream\", {isMuted: arg});\n",
    "./src/cscc.mediacc.js:        this.sendTelemetry(eventType, report);\n",
    "./src/cscc.mediacc.js:    mediaCC.prototype.sendTelemetry = function(eventType, report) {\n",
    "./src/cscc.mediacc.js:            me.sendTelemetry('video_receive_success' , {\n",
    "./src/cscc.mediacc.js:        me.sendTelemetry('start_VoIP_session', {\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry && me.sendTelemetry(\"reconnectPCs\",{\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry('restart_VoIP_session', {\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry('stop_VoIP_session', {\n",
    "./src/cscc.mediacc.js:        me.sendTelemetry('start_video_session', {\n",
    "./src/cscc.mediacc.js:            me.sendTelemetry('restart_video_session', {\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry('stop_video_session', {\n",
    "./src/cscc.mediacc.js:                    me.sendTelemetry('send_my_video', {\n",
    "./src/cscc.mediacc.js:            me.sendTelemetry('stop_my_video', {\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry('video_send_fail' , {\n",
    "./src/cscc.mediacc.js:          me.sendTelemetry('video_send_success' , {\n",
    "./src/cscc.mediacc.js:        //         me.sendTelemetry('video_send_success' , {\n",
    "./src/cscc.mediacc.js:        me.sendTelemetry('handle_send_video', {\n",
    "./src/cscc.mediacc.js:        this.sendTelemetry('subscribe_video', {\n",
    "./src/cscc.mediacc.js:        this.sendTelemetry('unsubscribe_video', {\n",
    "./src/cscc.mediacc.js:            shareCC.sendTelemetry('start_sharing_session', sessionParam);\n",
    "./src/cscc.mediacc.js:        shareCC.sendTelemetry('start_sharing_session', {\n",
    "./src/cscc.mediacc.js:                    me.sendTelemetry(eventName , {\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry('sharing_receive_success' , {\n",
    "./src/cscc.mediacc.js:                    me.sendTelemetry('sharing_send_success' , {\n",
    "./src/cscc.mediacc.js:                me.sendTelemetry('sharing_send_fail' , {\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry('stop_sharing_session_ex', {\n",
    "./src/cscc.mediacc.js:            this.sendTelemetry('stop_sharing_session', {confID: this.confID});\n",
    "./src/cscc.mediacc.js:            me.sendTelemetry('restart_sharing_session_mcs', {\n",
    "./src/cscc.mediacc.js:            me.sendTelemetry('restart_sharing_session_cb', {confID: me.confID});\n",
    "'''\n",
    "i = 0\n",
    "arrLines = theLines.split('\\n');\n",
    "for line in arrLines:\n",
    "    action = None\n",
    "    result = re.search('sendTelemetry\\(\\'(.*)\\'', line)\n",
    "    if result:\n",
    "        action = result.group(1)\n",
    "    else:\n",
    "        result1 = re.search('sendTelemetry\\(\\\"(.*)\\\"', line)\n",
    "        if result1:\n",
    "            action = result1.group(1)\n",
    "        else:\n",
    "            #print(line)\n",
    "            pass\n",
    "    if action:\n",
    "        i = i + 1\n",
    "        print(\"{}. {}\".format(i, action))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
